home *** CD-ROM | disk | FTP | other *** search
/ Wonky Flux Batch 2019 02 / Wonky_Flux_Batch_2019-02.zip / Wonky Flux Batch 2019-02 / 075 - Clash of Arms.dsk / WAR.MAIL.S < prev    next >
Text File  |  2019-02-17  |  15KB  |  493 lines

  1.  
  2.                          ;E-Mail Module for GBBS.Pro v1.3
  3.                          ;Original Author Unknown
  4.                          ;Albeit a rip-off of other
  5.                          ;peoples work...
  6.  
  7.                          ;Modified 10/16/88
  8.                          ;Greg W. Davis
  9.                          ;Sysop WEST WORLD
  10.                          ;415-992-4908
  11.  
  12.                          ;Modified 5/20/89
  13.                          ;Mach Three
  14.                          ;for Clash of Arms
  15.                          ;Sysop The Sound Barrier
  16.                          ;916-758-9540 9600 Baud
  17.  
  18.           public rd.mail
  19.           public sd.mail
  20.  
  21.           on nocar goto link.term
  22.           goto email
  23.  
  24. sd.mail
  25.           on nocar goto link.term
  26.           gosub wr.ltr
  27.           goto link.main
  28.  
  29. killmail
  30.           ready "g:war.mail"
  31.           if msg(un) ka=1:else ka=0
  32.           if not (ka) goto link.main
  33.           print \"Trash your messages? ([Y]/N) ";:input @2 zp$
  34.           if zp$="N" goto link.main
  35.           ready "g:war.mail":kill #msg(un):update
  36.           return
  37.  
  38. rd.mail
  39.           gosub rd.mail0
  40.           gosub killmail
  41.  
  42. link.main
  43.           link "a:war.start","maincommand"
  44.  
  45. email
  46.           print\ "Diplomacy (?=Menu): ";:input i$:push email
  47.           k$=k$+"/"+i$
  48.           if (i$="SNOOP") and (info(5)) then goto snoop.pass
  49.           if i$="R" then goto rd.mail0
  50.           if i$="S" then s=8:goto snd.mail
  51.           if i$="I" then goto ignore
  52.           if i$="D" then goto dump
  53.           if i$="N" then goto note
  54.           if (i$="A") or (i$="Q") then pop:gosub killmail:goto link.main
  55.           if i$="?" then print chr$(12):print'
  56.           _  _  _  _  _  _  _  _  _  _  _  _  _
  57. (_)(_)(_)(_)(_)(_)(_)(_)(_)(_)(_)(_)(_)
  58. |         |                                 | |
  59. |         |        Diplomacy Menu           | |
  60. (         )_________________________________( )
  61. |         |                                 | |
  62. |         |   (D) Show Diplomacy Notices    | |
  63. |         |   (N) Change Diplomacy Notices  | |
  64. |         |   (R) Read Messages             | |
  65. |         |   (S) Send Messages             | |
  66. |         |                                 | |
  67. |         |   (I) Ignore Messages           | |
  68. |         |   (Q) Quit Back to Main         | |
  69. |_|       _  _  _  _  _  _  _  _  _  _  _ |_|
  70. (_)(_)(_)(_)(_)(_)(_)(_)(_)(_)(_)(_)(_)':return
  71.  
  72.           print\"'"i$"' is not a Commmand. '?'=Help":return
  73.  
  74. rd.mail0
  75.           on nocar goto link.term
  76.           print \" ** Read War Messages **"
  77.           ready "g:war.mail"
  78.           if not msg(un) print \"No messages for you.":return
  79.  
  80. rd.2
  81.           ready #msg(un)
  82.           y1=0:y2=0
  83.           print
  84.  
  85. rd.1
  86.           y2=y2+1
  87.           input#7,i$,a$,h$,ce$
  88.           b$="  "
  89.           b2$=""
  90.           b2$=str$(y2)
  91.           if not instr(b2$,fi$) then b$=" >"
  92.           if i$<>"" then print b$"#"y2". "a$" "h$
  93.           copy #7,#10:clear#10
  94.           if i$<>"" then y1=y1+1: goto rd.1:else y2=y2-1
  95.           print\"[C/R=Exit] Select 1-"y2" Messages: ";:input @2 i$
  96.           if i$="?" then goto rd.2
  97.           if i$="" then ma=1:y=0:return
  98.  
  99. rd.3
  100.           x1=val(i$)
  101.           if x1<=0 then goto rd.2
  102.           ready #msg(un)
  103.           y2=0
  104.  
  105. rd.mail2
  106.           y2=y2+1
  107.           x=0:input#7,i$,a$,h$,ce$:d=val(i$):ce=val(ce$)
  108.           if i$="" then ma=1: y=0:return
  109.           if y2=x1 then goto rd.mail3
  110.           copy#7,#10:clear#10
  111.           goto rd.mail2
  112.  
  113. rd.mail3
  114.           print #x,\md$
  115.           setint (2):copy #7,#x
  116.           setint (""):print #x,md$\:print #x,"Letter "y2" of "y1
  117.           if key(2) goto wr1.ltr
  118.  
  119. rd.mail4
  120.           input@2\"Enter Option [?=Menu] or [C/R]: "i$
  121.           k$=k$+"/"+i$
  122.           if i$="?" then print'
  123.           _  _  _  _  _  _  _  _  _  _  _  _  _
  124. (_)(_)(_)(_)(_)(_)(_)(_)(_)(_)(_)(_)(_)
  125. |         |                                 | |
  126. |         |       Diplomacy Sub-Menu        | |
  127. (         )_________________________________( )
  128. |         |                                 | |
  129. |         |  (A) Send Reply                 | |
  130. |         |  (F) Forward Message            | |
  131. |         |  (N) Next Message               | |
  132. |         |  (R) Re-read Message            | |
  133. |         |                                 | |
  134. |         |  (Q) Quit                       | |
  135. |         | _  _  _  _  _  _  _  _  _  _  _ | |
  136. (_)(_)(_)(_)(_)(_)(_)(_)(_)(_)(_)(_)(_)'
  137.  
  138.  
  139.           if i$="" then i$=str$(y2+1):goto wr1.ltr
  140.           if (left$(i$,1)="C") or (i$="N") goto wr1.ltr
  141.           if i$="Q" return
  142.           if i$="R" rewind:x=0:goto rd.mail3
  143.           if (i$="W") and (info(5)) goto wr.mail
  144.           if i$="F" goto forward
  145.           if i$<>"A" goto rd.mail4
  146.           if d=0 print \"Sorry, anonymous sender":goto rd.mail4
  147.           print\"Subject : "h$
  148.           input@2"Change Subject? (Y/[N]):"i$
  149.           if (i$="N") or (i$="") then h$="Re: "+h$:else input@3\"[C/R=None] Subject:"i$:h$= i$
  150.           ce=0
  151.           open#1,dr$+"omissions"
  152.           position #1,1040,d
  153.           input #1,a$,b$
  154.           close #1
  155.           if b$<>"" then print\"A notice outside the embassy reads:"
  156.           print\ b$
  157.           gosub editor
  158.           if not edit(2) print\"No reply made.":fi$=fi$+" "+str$(x1):goto rd.2
  159.           print \" \/ Please Wait..";:s=8: gosub wr.ltr
  160.           print ".Reply Sent! \/"
  161.           fi$=fi$+" "+str$(x1)
  162.           goto rd.2
  163.  
  164. wr.mail
  165.           input @2 \"Filename (to write):" i$:if i$="" goto rd.mail4
  166.           create i$:rewind:open #1,i$:input #7,i$
  167.           append #1:copy #7,#1:close #1 :goto rd.mail4
  168.  
  169. forward
  170.           print \"Forward Message"
  171.           a=d:gosub mail.who
  172.           if d=0 then d=a:goto rd.mail4
  173.           rewind:s=7
  174.           r$=".message forwarded":gosub snd.bulk
  175.           d=a: goto rd.2
  176.  
  177. snd.mail
  178.           on nocar goto link.term
  179.           print \" ** Send Diplomatic Message **"
  180.           gosub mail.who
  181.  
  182. snd.mai1
  183.           print:free
  184.           if sk=1:gosub carbon
  185.           if d=0 return
  186.           input@3\"[C/R=War] Subject: " h$
  187.           if h$="" then h$="War"
  188.           ce=0
  189.           open#1,dr$+"omissions"
  190.           position #1,1040,d
  191.           input #1,a$,b$
  192.           close #1
  193.           if sk=1 then b$=""
  194.           if b$ <>"" print\"A notice outside the embassy reads:"
  195.           print\ b$
  196.           gosub editor
  197.           if not edit(2) print"No Message Sent!": return
  198.           if sk=1 then r$=".Carbons Sent! **":else r$=".Message Sent! **"
  199.           s=8:goto snd.bulk
  200.  
  201. Getplyr
  202.           close
  203.           open #2,dr$+"WAR.MASTER"
  204.           position #2,35,(val(gn$)-1),(ka-1)*5:input #2,d
  205.           close
  206.           i$=str$(d)
  207.           return
  208.           
  209. mail.who
  210.           input @2 \"[L]ist Commanders, Name, Player #, or Player Letter : "i$
  211.           clear #10:if i$="" then d=0:return
  212.           if i$="L" then gosub userlist:goto mail.who
  213.           if instr(i$,"ABCDEF") ka=instr(i$,"ABCDEF"):gosub getplyr
  214.           gosub mail.wh2: print #10,d\0:return
  215.  
  216. carbon
  217.           print \"** Bulk Mailing **":x=1
  218.           y=5:if flag(1) then y=25
  219.  
  220. bulk1
  221.           input @2 \"[L]ist Commanders, Commander # or Name: "i$
  222.           if i$="L" then gosub userlist:goto bulk1
  223.           if i$="" then d=0:if x=1 return
  224.           if i$<>"" gosub mail.wh2:if d=0 goto bulk1
  225.           print #10,d:x=x+1:if d if x<y goto bulk1
  226.           d=1:return
  227.  
  228. mail.wh2
  229.           if left$(i$,1)="#" then i$=mid$(i$,2):goto snd.num
  230.           if val(left$(i$,1)) goto snd.num
  231.           d$=i$:if (d$="SYSOP") or (d$=sys$) then d=1:return
  232.           if not instr(" ",i$) d$=". "+d$
  233.           open #1,"b:users":d=1
  234.  
  235. snd.user
  236.           position #1,128,d
  237.           input #1,a$,b$\c$
  238.           if not a$+" "+b$=d$ goto d.1
  239.           open #2,dr$+"omissions"
  240.           position #2,1040,d
  241.           input #2,b1$,bd$:close #2
  242.           na$=a3$
  243.           if b1$="" goto d.d
  244.           if instr(na$,b1$) then print\'Sorry, this commander has expulded your diplomats, and refuses to answer any    messages.':d=0: close #1 :return
  245.  
  246. d.d
  247.           na$=a$+" "+b$
  248.           if instr(na$,d$) then close: return
  249.  
  250. d.1
  251.           if d<nu then d=d+1:goto snd.user
  252.           close #1:d=0
  253.           print \d$" is not a Commander.":return
  254. snd.usr2
  255.           print \"That person is not a Commander."\
  256.           d=0:return
  257.  
  258. snd.num
  259.           d=val(i$)
  260.           if (d<1) or (d>nu) goto snd.usr2
  261.           move ram,58 to ram2:open #1,"b:users"
  262.           position #1,128,d:input #1,a$,b$\c$
  263.           position #1,128,d,70:read #1,ram,58
  264.           close:if a$="" goto snd.usr2
  265.           na$=a3$
  266.           open #1,dr$+"omissions"
  267.           position #1,1040,d
  268.           input #1,b$,i$:close #1
  269.           if b$="" then goto snd.num1
  270.           if instr(na$,b$) then print\'
  271. Sorry,    this commander has expulded your diplomats, and refuses to answer any    messages.':d=0:goto snd.num2
  272.  
  273. snd.num1
  274.           print \"Send to Commander "c$\"Last on "when$;
  275.           input @2 "? ([Y]/N):" i$
  276.           if left$(i$,1)="N" then d=0
  277. snd.num2
  278.           move ram2,58 to ram
  279.           return
  280. snd.bulk
  281.           fo$=""
  282.           print \"** Please Wait..";:mark(10)=0
  283. snd.blk2
  284.           input #10,d:if d=0 print r$:return
  285.           fo$=fo$+"+"+str$(d)
  286.           gosub wr.ltr:goto snd.blk2
  287.  
  288. wr.ltr
  289.           on nocar goto link.term
  290.           a$=a3$
  291.           a$=a$+" (#"+right$("000"+str$(un),3)+")"
  292.           y=len(a$)
  293.           y=27-y
  294.           a$=a$+chr$(32,y)
  295.           ready "g:war.mail"
  296.           if info(6)<29 print \"Mail bit-map full.  Notify Sysop IMMEDIATELY!":return
  297.           print #msg(d),un,a$,h$,ce
  298.           if t$<>"" then print#6,t$
  299.           print #6,"Commander: "a3$" (#"un")"
  300.           when$=date$
  301.           print #6,"Received : "time$" on "date$
  302.           print #6,"Subject  : "h$\
  303.           copy #s,#6
  304.           print #msg(d),chr$(4);chr$(0);
  305.           msg(d)=1:update:return
  306.  
  307.                          ; enter message
  308.  
  309. editor
  310.           free
  311.           print\"Enter War Message Now.  .S to Send your diplomats, DONE to edit."
  312.           cl=clock(2):clock(2)=0:edit(0):edit(1):clock(2)=cl:return
  313.  
  314.                          ; display file to screen
  315.  
  316. show.file
  317.           setint(1):print \s$\:open #1,f$:if mark(1) close #1:return
  318.  
  319. showfl2
  320.           copy (20) #1
  321.           if (eof(1) or key(1)) setint(""):close #1:return
  322.           if not flag(35) goto showfl2
  323.           print "Press <RETURN> ";:get i$:if i$=chr$(13) print " ";
  324.           print chr$(8,16);chr$(32,16);chr$(8,16);
  325.           if i$=" " setint(""):close #1:return
  326.           setint(1):goto showfl2
  327.  
  328. wr1.ltr
  329.           gosub wr1.lt1
  330.           fi$=fi$+" "+str$(x1)
  331.           i$=mid$(i$,2):a=val(i$)
  332.           if a then goto rd.3
  333.           goto rd.2
  334.  
  335. wr1.lt1
  336.           if d=0  then return
  337.           if ce=0 then return
  338.           edit(0): s=8:gosub wr.ltr.recieved
  339.           return
  340.  
  341. wr.ltr.recieved
  342.           if ma=1 then return
  343.           b2$=str$(x1)
  344.           if instr(b2$,fi$) then return
  345.           a$="Post Office                "
  346.           ready "g:war.mail"
  347.           if info(6)<29 print \"Mail bit-map full!  Notify Sysop IMMEDIATELY!!":return
  348.           print #msg(d),0,a$,h$
  349.           print #6,"From    : Post Office"
  350.           print #6,"Sent to : "a3$" (#"un"):
  351.           print #6,"Subject : "h$
  352.           when$=date$
  353.           print #6,"Received: "time$" on "date$\
  354.           print #6,"          No Reply"
  355.           print #6,"        to your last"
  356.           print #6,"           letter!"
  357.           copy #s,#6:print #msg(d),chr$(4);chr$(0);
  358.           msg(d)=1:update:return
  359.  
  360. ignore
  361.           print\"       <> Ignore Messages From Commanders <>"
  362.           print "   (These Commanders may not send mail to you)"
  363.           print\\"Current Omissions Are:";
  364.           create dr$+"omissions":open #1,dr$+"omissions"
  365.           position #1,1040,un
  366.           input #1,a$,b$
  367.           close #1
  368.           print a$
  369.  
  370. ignore1
  371.           input\"[?=Menu] Ignore :"i$:push ignore1
  372.           if i$="C"then goto clear
  373.           if i$="A"then goto add
  374.           if i$="V"then goto ignore
  375.           if i$="Q"then goto email
  376.           if i$="?"then print'
  377.  
  378.           (C) Clear Omissions  (A) Add Omissions
  379.           (V) View Omissions   (Q) Quit':return
  380.           print\"( "i$" ) Illegal Command":return
  381.           return
  382.  
  383. clear
  384.           create dr$+"omissions"
  385.           open #1,dr$+"omissions"
  386.           position #1,1040,un
  387.           input #1,a$,b$
  388.           a$=""
  389.           position #1,1040,un
  390.           print #1,a$,b$
  391.           close #1
  392.           print\\"Omissions are now cleared out!"\:return
  393.  
  394. add
  395.           input@3\\"Enter the Commander`s first name :"i$
  396.           a$=a$+" "+i$
  397.           input@3\\"Enter the Commander`s last name   :"i$
  398.           a$=a$+" "+i$
  399.           create dr$+"omissions"
  400.           open #1,dr$+"omissions"
  401.           position #1,1040,un
  402.           print #1,a$,b$
  403.           close #1:return
  404.  
  405. Note
  406.           print\"** Embassy Notice **"
  407.           print\"Your notice reads:"\
  408.           create dr$+"omissions"
  409.           open#1,dr$+"omissions"
  410.           position #1,1040,un
  411.           input #1,a$,b$
  412.           close #1
  413.           print b$
  414.           input@2\"Change it? (Y/[N]):"i$
  415.           if i$<>"Y" then return
  416.           print"Enter New notice now :"
  417.           input@3\":)"i$
  418.           open #1,dr$+"omissions"
  419.           position #1,1040,un
  420.           print #1,a$,i$
  421.           close #1
  422.           goto email
  423.  
  424. dump
  425.           print\"Begin at Commander [#1-"nu"] ? ";:input i$
  426.           y=val(i$)
  427.           if y<1 or y>nu then return
  428.           create dr$+"omissions"
  429.           open #1,dr$+"omissions"
  430.           print\ "User Notices :"\
  431.           for x=y to nu
  432.           position #1,1040,x
  433.           input #1,a$,b$:setint(1)
  434.           if b$<>"" then print x":"\b$\
  435.           if key(1) setint(""):x=nu
  436.           next
  437.           close #1:return
  438.  
  439. userlist
  440.           print \" ** List of Commanders **"\
  441.           input @2 "Name to Match [Q]uit or [C/R] = All: "i$
  442.           if i$="Q" then return
  443.           print \s$\
  444.           open #1,"b:users":x=1
  445.           if left$(i$,1)="#" x=val(mid$(i$,2)):i$=""
  446.           if (x=0) or (x>nu) then x=1
  447.           print\'
  448.            #           Name             Last on
  449. =========================================='\
  450. usrlst2
  451.           position #1,128,x:input #1,a$,b$
  452.           setint(1):if a$="" goto usrlst3
  453.           a$=a$+" "+b$:if not instr(i$,a$) goto usrlst3
  454.           input #1,b$\b$:position #1,128,x,70
  455.           move ram,58 to ram2:on nocar goto usrlst4::read #1,ram,58
  456.           setint(1)
  457. usrlst2a
  458.           p1$=right$("    "+str$(x),4):a$=left$(a$+"                    ",20)
  459.           print p1$"   "a$"   "when$
  460. usrlst2b
  461.           move ram2,58 to ram:on nocar goto link.term
  462. usrlst3
  463.           if (not key(1)) and (x<nu) then x=x+1:goto usrlst2
  464.           close:return
  465.  
  466. usrlst4
  467.           move ram2,58 to ram
  468.  
  469. link.term
  470.           link "a:main.seg","term1"
  471.  
  472. snoop.pass
  473.           if not info(5) then return
  474.           print \"Snooping mail file..."
  475.           ready "g:war.mail":open #1,"b:users"
  476.           z=2
  477. snoop0
  478.           position #1,128,z:input #1,z$,z1$
  479.           if (z$="") or (not msg(z)) goto snoop2
  480.           print \z$" "z1$" has mail. [R]ead or [Q]uit ? ";
  481.           input z$:if z$="Q" then close:return
  482.           if z$<>"R" goto snoop2
  483.  
  484.           ready #msg(z)
  485. snoop1
  486.           input #7,i$:if i$="" goto snoop2
  487.           setint(1)
  488.           copy #7:goto snoop1
  489.           setint(1)
  490. snoop2
  491.           if (not key(1)) and z<nu then z=z+1:goto snoop0
  492.           close:return
  493.